package com.briup.day12.bean;

public class Outer {
    private int o_num=10;
    private int num=20;
    public class inner{
        private int i_num=30;
        private int num=40;
        //内部类不可以定义静态成员和方法
        //测试对外部成员访问
        public void show(){
            System.out.println(o_num);
            System.out.println(Outer.this.num);//同名变量
            int num=50;
            System.out.println(num+"局部变量");
            System.out.println("内部成员"+i_num);
            System.out.println("this.num"+this.num);
        }
    }
    public void disp(){
        //实例内部类对象
        //外部类.内部类=this.new inner();
        Outer.inner inn=this.new inner();
        System.out.println(inn.i_num);
        //简化版格式
        inner inn2=new inner();
        System.out.println(inn2.num);
    }
}
